package org.xshop.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xshop.model.SysNews;
import org.xshop.service.ISysNewsService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import top.ibase4j.core.base.BaseController;
import top.ibase4j.core.util.WebUtil;

/**
 * 新闻管理控制类
 * 
 * @author ShenHuaJie
 * @version 2016年5月20日 下午3:13:31
 */
@RestController
@Api(value = "新闻管理", description = "新闻管理")
@RequestMapping(value = "/app/news")
public class SysNewsController extends BaseController<SysNews, ISysNewsService> {
	@ApiOperation(value = "查询新闻")
	@PostMapping(value = "/getList.api")
	public Object query(HttpServletRequest request) {
		Map<String, Object> param = WebUtil.getParameter(request);
		Object result = service.queryAll(param);
		return setSuccessModelMap(result);
	}

	@ApiOperation(value = "新闻详情")
	@PostMapping(value = "/detail.api")
	public Object get(ModelMap modelMap, @RequestBody SysNews param) {
		return super.get(modelMap, param);
	}
}
